/* We'd probably make it a separate Rexx program normally, for ease of */
/* maintenance. */
/* Arguments are: the unique file name, search to do, and words [UR form]. */
/* It returns the GoServe command to handle the result file. */
search: procedure
parse arg file, type, list /* could easily be uppercased */
parse var list list '&' checks /* split off all checkboxes etc. */
/* If this came with our name, use the value */
/* If came from an old form, with an ISINDEX tag, can handle that, too */
/* If this came from an old form and old client, use list as-is */
/* But if the name isn't the one we put in the form, use empty list. */
parse var list name '=' value
select
when name='searchText' then list=value /* usual case */
when name='isindex' then list=value /* for very simple forms */
when pos('=', list)=0 then nop /* as-is case */
otherwise
nop
/* list='' */ /* invalid name */
end
list=packur(list) /* pack escape sequences in list */
sql = translate(list, ' ', '+'||'090a0d'x)
address cmd
'del' file '1>NUL 2>NUL'
call g2connectshare 'SAMPLE'
call G2H file, 1, '<html><head><title>G2HTable Process Page</title></head><body bgcolor="#FF00FF" fgcolor="#000000">'
call G2H file, 1, '<h3>Welcome to <b><i>RexxGDB2</i></b>, Query DB2/2 Data Easy, Fast</h3>'
call G2H file, , 'Please enter below an SQL query to against STAFF, ORG, DEPARTMENT or any other text-containing DB2/2 Sample database tables. Joins are okay.'